{	Problem: http://codeforces.ru/problemset/problem/44/H
	Verdict: Accepted
}
uses 
  SysUtils, Math;
    
var 
    s:string;
    ls,kk,i,j,pp:longint;
    a:array[0..1010,0..10] of int64;
    ans:int64;
    f:boolean;

begin
fillchar(a,sizeof(a),0);
readln(s);
ls:=length(s);
kk:=ls-1;
ans:=0;
for i:=0 to 9 do
    a[1][i]:=1;
for i:=1 to kk do begin
    for j:=0 to 9 do begin
        pp:=j+ord(s[i+1])-48;
        inc(a[i+1][pp div 2],a[i][j]);
        if pp and 1=1 then inc(a[i+1][(pp+1) div 2],a[i][j]);
    end;
end;
for i:=0 to 9 do
    inc(ans,a[ls][i]);
f:=true;
for i:=2 to ls do
    if abs(ord(s[i])-ord(s[i-1]))>1 then begin
        f:=false;
        break;
    end;
if f then dec(ans);
write(ans);
end.